#include "Message.h"

unsigned long ID::machineID = 0;
MessageHeader::MessageHeader(int type, int length, ID id) : _id(id)
{
	this->_type = type;
	this->_length = length;
}

//------------------------------------------------>

MessageHeader::~MessageHeader()
{
}

ObjectMessage::ObjectMessage(int type, int length, ID id)
	: MessageHeader(type, length, id)
{

	//Quaternion
	attitude = 0.0f;
	fX = 0;		
	fY = 1;		
	fZ = 0;	

	//World Position
	positionX = 0;
	positionY = 0;
	positionZ = 0;
}


//------------------------------------------------>

ObjectMessage::~ObjectMessage()
{
}

ControlMessage::ControlMessage(ID id)
	: MessageHeader(CONTROL, sizeof(ControlMessage), id)
{
	mouseX = mouseY =			0;
	moveX = moveY = moveZ =		0;
	fire =						0;
}

PlayerMessage::PlayerMessage(ID id)
	: ObjectMessage(PLAYER, sizeof(PlayerMessage), id)
{
	machineID = 0;
}

ItemMessage::ItemMessage(ID id)
	: ObjectMessage(ITEM, sizeof(ItemMessage), id)
{
	itemType = 0;
}
